using Reflector.CodeModel;

namespace Reflector.CodeDom
{
    internal sealed class CodeDomLanguage : ILanguage
    {
        // Methods

        #region ILanguage Members

        /// <summary>
        /// Gets the writer.
        /// </summary>
        /// <param name="formatter">The formatter.</param>
        /// <param name="configuration">The configuration.</param>
        /// <returns></returns>
        public ILanguageWriter GetWriter(IFormatter formatter, 
            ILanguageWriterConfiguration configuration)
        {
            return new CodeDomLanguageWriter
                (formatter, configuration);
        }

        // Properties
        /// <summary>
        /// Gets the file extension.
        /// </summary>
        /// <value></value>
        public string FileExtension
        {
            get { return "cdm"; }
        }

        /// <summary>
        /// Gets the name.
        /// </summary>
        /// <value></value>
        public string Name
        {
            get { return "CodeDom"; }
        }

        /// <summary>
        /// Gets a value indicating whether this <see cref="CodeDomLanguage"/> can translate.
        /// </summary>
        /// <value><c>true</c> if translate; otherwise, <c>false</c>.</value>
        public bool Translate
        {
            get { return true; }
        }

        #endregion
    }
}